-- GENERATED SPELL FOR [Winterskorn Rune-Caster] --


function spell0_23668(pUnit, Event) --@Exploding Runes,n/a--
pUnit:FullCastSpellOnTarget(37798,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23668', 2000, 1)
end

function spell1_23668(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(12548,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23668', 8280, 1)
end

function spell2_23668(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(43083,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23668', 6000, 1)
end

function Sorts_23668(pUnit, Event)
local choix_sorts_23668 = math.random(0, 2)
if choix_sorts_23668 == 0 then
pUnit:RegisterEvent('spell0_23668', 1, 1)
end
if choix_sorts_23668 == 1 then
pUnit:RegisterEvent('spell1_23668', 1, 1)
end
if choix_sorts_23668 == 2 then
pUnit:RegisterEvent('spell2_23668', 1, 1)
end
end

function mob23668_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23668', math.random(1500, 3000), 1)
end

function mob23668_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23668_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23668_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23668, 1, 'mob23668_Action')
RegisterUnitEvent(23668, 2, 'mob23668_Leave')
RegisterUnitEvent(23668, 3, 'mob23668_Kill')
RegisterUnitEvent(23668, 4, 'mob23668_Die')
